import Vue from 'vue'
import Router from 'vue-router'
// import { Indicator } from 'mint-ui'

Vue.use(Router)
const router = new Router({
  mode: 'history',
  base: '/',
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      const position = {}
      // scroll to anchor by returning the selector
      if (to.hash) {
        position.selector = to.hash
        // specify offset of the element
        if (document.querySelector(to.hash)) {
          return position
        }
        // if the returned position is falsy or an empty object,
        // will retain current scroll position.
        return false
      } else {
        return {
          x: 0,
          y: 0
        }
      }
    }
  },
  routes: [
    {
      path: '/',
      component: () => import(/* webpackChunkName: "group-index" */ './pages/demo/demo'),
    }
  ]
})
export default router
